package demo2;

public class Generic <T> {
    private T key;

    //构造方法
    public Generic(){

    }
    public Generic(T key) {
        this.key = key;
    }

    public void setKey(T key) {
        this.key = key;
    }

    public T getKey() {
        return key;
    }

    @Override
    public String toString() {
        return "Generic{" +
                "key=" + key +
                '}';
    }
}
